<?php 

	
	/*trang nay lay du lieu tu client :*/


	//ket noi co so du lieu
	$hostName_Or_HostIP_S='localhost';
	$userName_S='picachusays';
	$password_S='qqqqqqqq';
	$dataBaseName_S='TracNghiem';
	$connect=mysqli_connect($hostName_Or_HostIP_S,$userName_S,$password_S);
	mysqli_select_db($connect,$dataBaseName_S);


	//cau truy van
	$result = mysqli_query($connect,"SELECT * FROM TaiKhoan");
	$hienRa=array('success'=>true,'taiKhoan'=>array());
	?>
		
		<?php
			$i=0;
		
			while($row = mysqli_fetch_array($result,MYSQL_ASSOC))
			{
				//$row['tenTaiKhoan'] ;$row['matKhau'] ;$row['tenNguoiDung'] ;$row['email'] ;
				
				$dong=array();
				$ten1=$row['tenTaiKhoan'];
				$mat1=$row['matKhau'];
				$ten2=$row['tenNguoiDung'];
				$ema1=$row['email'];
				
				$dong['tenTaiKhoan']=$ten1;
				$dong['matKhau']=$mat1;
				$dong['tenNguoiDung']=$ten2;
				$dong['email']=$ema1;
				
				$hienRa['taiKhoan'][]=$dong;
			}
		?>
	<?php
	
	
	echo "\n",json_encode($hienRa);
	//dong ket noi
	mysqli_close($connect);

?>